<?php
namespace app\validate;
use share\validate\SceneValidate;

class ToolkitUserValidate extends SceneValidate{

    /**
     * 通用规则
     */
    protected $rule = [
        'id' => 'require|integer',
        'account' => 'length:2,16',
        'pk' => 'require|length:6,30',
        'dn' => 'require|length:10,64',
    ];    

    /**
     * 自定义场景的规则
     */
    protected $sceneRules = [
        'set' =>[
            'id' => 'require|integer',
            'account' => 'length:2,16',
            'pass' => 'length:6,20',
        ],
    ];

    protected $scene = [
        'list' => ['account'],
        'set' => ['id','account','pass'],
        'login' => ['account','pass'],
        'sendUnbindMessage' => ['pk','dn'],
    ];
}
